<?php
  
	require 'PROTECAO.php';
  
	class USUARIO
	{
		private $nome;
		private $id;
    private $facebook;
    public $itens;
		
		public function __construct($id) {
      this->id = $id;
      loadUsuario();
		}
      
     public function loadUsuario() {
       $query = 'SELECT NOME FROM USUARIOS WHERE ID = '.$ID; //TODO: cuidar com sql injection
       
       $resp = mysql_query($query);
       $campos = mysql_fetch_array($resp);
       
       $this->nome = $campos['NOME'];
     }
     
     public function getNome() {
       return this->nome;
     }
     
     public function getItens() {
       $result = $DB->queryArray('SELECT * FROM ITENS WHERE ID_DONO = '.$ID);
       $this->itens = $result;
     }
	}
   
?>